import java.util.Arrays;

public class test {
    public static void main(String[] args) {
//        Student student1 = new Student("zhangsan",9);
//        Student student2 = new Student("lisi",19);
//        System.out.println(student1.compareTo(student2));

        Student[] students = new Student[3];
        students[0] =new Student("zhangsan",10);
        students[1] =new Student("lisi",9);
        students[2] =new Student("abc",19);

        System.out.println("排序前"+Arrays.toString(students));
        NameComparator nameComparator = new NameComparator();
//        AgeComparator ageComparator = new AgeComparator();
        Arrays.sort(students,nameComparator);
        System.out.println("排序后"+Arrays.toString(students));

    }
}
